<template>
	<view class="container">
		
		<view>
			<view class="wrap" v-for="(item,index) in wrapList" :key="item.key">
				<view class="wrap_tit">
					<view class="wrap_top">
						<view class="wrap_name">{{item.profitType == 1 ? "推广收益" : item.profitType == 2 ? "业绩奖励" : item.profitType == 3 ? "季度奖励" : item.profitType == 4 ? "提现" : item.profitType == 5 ? "招商奖励" : item.profitType == 6 ? "助力奖励" : ""}}</view>
						<view class="wrap_count">{{item.profit}}</view>
					</view>
					<view class="wrap_bottom">
						<view>{{item.addTime}}</view>
						<view>可提现余额:¥{{item.balance}}</view>
					</view>
				</view>
			</view>
			
			
			<!-- 空白页 -->
			<empty v-if="wrapList.length === 0"></empty>
			
			<view class="no-data">
				<p>~没有更多内容~</p>
			</view>
		</view>
	</view>
</template>

<script>
	import empty from "@/components/nomore";
	
	export default {
		components: {
			empty
		},
		
		data() {
			return {
				wrapList:[]
			}
		},

		onLoad(options) {
			let stateOrder = options.id;
			let title = '我的收益';
			if (stateOrder === '1') {
				title = '销售收益'				
			}
			uni.setNavigationBarTitle({
				title
			})
			
			
			let _this = this;
			_this.tui.request('/app/profit/list', 'GET', {}, false, false, false, ).then(res => {
				_this.wrapList = res.data.list
				
			}).catch(err => {
				console.log(err)
			})
		},

		methods: {
			
		}
	}
</script>

<style lang='scss'>
	page {
		background: #FAFAFA;
	}
	
	.wrap{
		padding: 20upx 20upx;
		display: flex;
		align-items: center;
		background-color: #ffffff;
		border-bottom: 1px solid rgba(242,242,242,1);
		
		.wrap_img{
			width: 15%;
			text-align: center;
				
			image{
				width: 90upx;
				height: 90upx;
			}
		}
		
		.wrap_tit{
			width: 100%;
			color: #333333;
			font-size: 14px;
			padding-left: 18upx;
			
			.wrap_top{
				display: flex;
				align-items: center;
				justify-content: space-between;
				
				.wrap_name{
					font-size:32upx;
					font-family:PingFang SC;
					font-weight:400;
					color:rgba(51,51,51,1);
					line-height:29px;
					padding-right: 12upx;
				}
				.wrap_count{
					font-size:32upx;
					font-family:PingFang SC;
					font-weight:bold;
					color:rgba(255,0,0,1);
					line-height:29px;
				}
				
				
			}
			.wrap_bottom{
				display: flex;
				align-items: center;
				justify-content: space-between;
				
				font-size:24upx;
				font-family:PingFang SC;
				font-weight:400;
				color:rgba(153,153,153,1);
				line-height:29px;
				
				
			}
			
		}
		
	}
	/* 暂无数据 */
	.no-data {
		font-size: 24upx;
		line-height: 40upx;
		margin: 50upx 0;
		text-align: center;
		color: #CCCCCC;
	}
</style>
